﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Rescue_of_the_Dwarvenzombies.Rendering.RenderStates
{
    /// <summary>
    /// The abstract class that the different states inherits.
    /// </summary>
    /// <remarks></remarks>
    public abstract class RenderState
    {
        protected Game Game;

        /// <summary>
        /// Gets or sets the sprite batch.
        /// </summary>
        /// <value>The sprite batch.</value>
        /// <remarks></remarks>
        protected SpriteBatch SpriteBatch { get; set; }
        /// <summary>
        /// Gets or sets the sprite font.
        /// </summary>
        /// <value>The sprite font.</value>
        /// <remarks></remarks>
        protected SpriteFont SpriteFont { get; set; }
        /// <summary>
        /// Gets or sets the animation manager.
        /// </summary>
        /// <value>The animation manager.</value>
        /// <remarks></remarks>
        protected AnimationManager AnimationManager { get; set; }
        /// <summary>
        /// Gets or sets the render state manager.
        /// </summary>
        /// <value>The render state manager.</value>
        /// <remarks></remarks>
        protected RenderStateManager RenderStateManager { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="RenderState"/> class.
        /// </summary>
        /// <param name="game">The game.</param>
        /// <param name="renderStateManager">The render state manager.</param>
        /// <remarks></remarks>
        protected RenderState(Game game, RenderStateManager renderStateManager)
        {
            Game = game;
            SpriteBatch = new SpriteBatch(game.GraphicsDevice);
            AnimationManager = new AnimationManager(game);
            RenderStateManager = renderStateManager;
        }

        /// <summary>
        /// Updates the specified game time.
        /// </summary>
        /// <param name="gameTime">The game time.</param>
        /// <remarks></remarks>
        public abstract void Update(GameTime gameTime);

        /// <summary>
        /// Draws this instance.
        /// </summary>
        /// <remarks></remarks>
        public abstract void Draw();
    }
}